<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<meta name="description"
    content="The width of the red floating boxes should be calculated as
    shrink-to-fit. The boxes with multi-line text should span the entire width">
<style>
@page {
    size: 400pt 300pt;
    margin: 50pt;
}

html {
    font-family: sans-serif;
    font-size: 14pt;
    line-height: 18pt;
}

span {
    display: inline-block;
    outline: solid red;
}
</style>
</head>

<body>
    <div>inline-block with multi-line text
    <span>Lorem ipsum dolor sit amet, consectetur adipisici elit,
    sed eiusmod tempor incidunt ut labore et dolore magna aliqua.</span></div>
</body>

</html>
